package com.weipai.springboot.module.dao.impl;

import com.weipai.springboot.model.Advertising;
import com.weipai.springboot.model.PcNews;
import com.weipai.springboot.module.dao.PcNewsDao;
import com.weipai.springboot.module.mapper.PcNewsMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author: 曹朋飞
 * @Date: 2019/01/09 13:47
 */
@Repository
public class PcNewsDaoImpl implements PcNewsDao {
    
    @Autowired
    private PcNewsMapper pcNewsMapper;

    @Override
    public List<Advertising> list(Integer start, Integer size, String type) {
        return pcNewsMapper.list(start, size, type);
    }

    @Override
    public Integer amount(String type) {
        return pcNewsMapper.amount(type);
    }

    @Override
    public int updateByPrimaryKeySelective(PcNews pcNews) { 
        return pcNewsMapper.updateByPrimaryKeySelective(pcNews);
    }

    @Override
    public int insert(PcNews pcNews) {
        return pcNewsMapper.insert(pcNews);
    }

    @Override
    public PcNews selectByPrimaryKey(String id) {
        return pcNewsMapper.selectByPrimaryKey(Integer.parseInt(id));
    }

    @Override
    public int deleteByPrimaryKey(String id) {
        return pcNewsMapper.deleteByPrimaryKey(Integer.parseInt(id));
    }
}
